#ifndef _CAMERA_H
#define _CAMERA_H

#include "common.h"

class Camera
{
    public:
    Camera();

    void eventHandle(sf::Event event);
    void inputHandle();
    void update(double dt);

    void zoomIn();
    void zoomOut();

    void panLeft();
    void panRight();
    void panUp();
    void panDown();

    sf::View* getView(){return &view;}

    enum ViewAngle
    {
        ANGLE_NW = 0,
        ANGLE_NE = 1,
        ANGLE_SE = 2,
        ANGLE_SW = 3
    };

    Camera::ViewAngle   getAngle(){return angle;}
    void                setAngle(Camera::ViewAngle angle){this->angle = angle;}

    void    rotateCW();
    void    rotateCCW();

    sf::Vector2f getPos(){return pos;}

    sf::Vector2i    getDimensions(){return dimensions;}
    void            setDimensions(sf::Vector2i dimensions){this->dimensions = dimensions;}

    double getZoomLevel(){return zoomLevel;}

    private:
    sf::Vector2f pos;
    sf::Vector2f vel;
    sf::Vector2i dimensions;

    double moveFriction;
    double moveSpeed;
    double maxMoveSpeed;

    ViewAngle angle;

    sf::View view;
    double zoomLevel;
    double zoomFactor;

};

#endif
